<%@ page contentType="text/html; charset=UTF-8" %>

<%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="/WEB-INF/tld/extend.tld" prefix="extend"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
	<head>
		<title>乐盈培训网 - 我的中心</title>
		<link href="<extend:contextPath name="contextPath"/>/css/style.css" rel="stylesheet" type="text/css" />
	</head>
	
	<body>
		<div style="position:absolute; height:100%; width:1045px;">
			<jsp:include page="header.jsp"></jsp:include>
			<table width="100%" border="0" cellpadding="0" cellspacing="0" style="font-size:12px;">
				<tr>
					<td height="25px">
						您现在的位置：<a href="<extend:contextPath name="contextPath"/>" class="normal_link">首页</a> >> 
						我的中心
					</td>
				</tr>
			</table>
			
			<div>
				我收藏的课程
			</div>
			
			<c:choose>
					<c:when test='${empty courseList}'>
					  <c:if test='${courseList != null}'>
					    <div>
					      您暂时还没有收藏任何课程.
					    </div>
					  </c:if>
					</c:when>
					<c:otherwise>
						<div id="publicCourse" style="float:left; width:730px; margin-top:5px; border: #D9D9D9 1px solid; padding-bottom:10px;">
						<html:form action="/cancelSubscribeCourse.do?method=cancelSubscribeCourse">
						<table width="100%" cellpadding="0" cellspacing="0" style="font-size:13px;">
							<tr>
								<td height="5" colspan="10"></td>
							</tr>
							<tr>
								<td colspan="10" height="30px">
									&nbsp;&nbsp;收藏课程共计： <font color="red"><c:out value="${count}" /></font>
								</td>
							</tr>
							<tr bgcolor="#3399cc">
								<td height="28" width="100%" style="line-height:28px;">
									<span style="float:left; width:30px; height:28px; color:#ffffff;">
										<input type="checkbox" style="margin-top:8px; margin-left:7px;"/>
									</span>
									<span style="float:left; width:50px; color:#ffffff; text-align:center"><b>S/No.</b></span>
									<span style="float:left; width:550px; color:#ffffff"><b>培训课程</b></span>
									<span style="float:left; width:100px; color:#ffffff"><b>收藏日期</b></span>
								</td>
							</tr>
							<c:forEach items="${courseList}" var="item" varStatus="status">
								<c:if test="${status.index%2 == 0}">
		    						<tr>
		    					</c:if>
		    					<c:if test="${status.index%2 == 1}">
		    						<tr bgcolor="#f2f9ff">
		    					</c:if>  
		    						<td height="28">
		    						<span style="float:left; width:30px; text-align:center">
			    						<html:multibox property="deleteSelection" 
											onclick="toggleMasterCheckbox(masterCheckbox, this.checked, deleteSelection)">
											<c:out value="${item.courseId}" />
										</html:multibox>
		    						</span>
									<span style="float:left; width:50px; text-align:center"><c:out value="${status.index + 1}" />.</span>
									<span style="float:left; width:550px;">
										<a target="_blank" class="normal_link" href="<extend:contextPath name='contextPath'/>/course/
													viewCourseDetail.do?method=viewCourseDetail&courseId=<c:out value="${item.courseId}"/>">
											<c:out value="${item.courseTitle}" />
										</a>
									</span>
									<span style="float:left; width:100px;"><c:out value="${item.createdDtAsStr}" /></span>
									</td>
								</tr>
							</c:forEach>
							
							<tr>
								<td>&nbsp;&nbsp;<html:submit styleClass="button" style="width:90px;" value="取消收藏课程"/></td>
							</tr>
						</table>
						</html:form>
						</div>							
					</c:otherwise>
			</c:choose>
		</div>
	</body>
</html>